package cn.edu.zust.se.shop.controller;

import cn.edu.zust.se.shop.domain.Order;
import cn.edu.zust.se.shop.dto.OrderDto;
import cn.edu.zust.se.shop.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("orders")
public class OrderController {
    @Autowired
    OrderService orderService;
    @PostMapping("/{productId}")
    public OrderDto addOrder(@PathVariable int productId, int num){
        return orderService.addOrder(1,productId,num);
    }
}
